import React, { Component } from 'react'
import PropTypes from "prop-types";

export default class BookList extends Component {
    // 设置属性限制
    static propTypes={
        bookInfo:PropTypes.object.isRequired
    }
    // 设置默认属性
    static defaultProps = {
        bookInfo:{
            bookList:[]
        }
    }
  render() {
    console.log(this.props.bookInfo);
    return (
      <div>
        {
            this.props.render()
        }
        {
            this.props.bookInfo.bookList.map(item=>(
                <div key={item.id}>
                    <h5>{item.bookName}</h5>
                    <img width={100} src={item.bookImg} alt=""/>
                </div>
            ))
        }
      </div>
    )
  }
}
